From: Katsumi Yamaoka Date: Thu, 4 Nov 2010 11:00:25 +0000 (+0000) Subject: shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the... X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5802 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4981f52db25ccec2815deb19b9de2a84458ea826;p=emacs.git shr.el (shr-tag-img): Use string-width and truncate-string-to-width to measure the length and truncate alt text. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0961e6703e6..8065f4a8f38 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-11-04 Katsumi Yamaoka + + * shr.el (shr-tag-img): Use string-width and truncate-string-to-width + to measure the length and truncate alt text. + 2010-11-03 Glenn Morris * nndiary.el (nndiary-generate-nov-databases-1) diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index cc3855bed04..5614e72f518 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -551,8 +551,8 @@ Return a string with image data." (string-match shr-blocked-images url))) (setq shr-start (point)) (let ((shr-state 'space)) - (if (> (length alt) 8) - (shr-insert (substring alt 0 8)) + (if (> (string-width alt) 8) + (shr-insert (truncate-string-to-width alt 8)) (shr-insert alt)))) ((url-is-cached (shr-encode-url url)) (shr-put-image (shr-get-image-data url) alt))